|
You'll notice
some new syntax in this example, but don't worry about it too much. Pay close
attention to the very first line, which checks to make sure that the amount
requested is less than the account balance. The way it works is, if the expression
between parentheses (()) evaluates to true, then the first block of code will be read. That is, the code inside
the first set of curly braces ({}) will be executed. If the expression in
parentheses evaluates to false, on the other hand, then the second block of
code (the code following the word else) will be read. In this
case, the first block of code withdraws the amount requested by the customer,
while the second block of code withdraws nothing, and notifies the customer.
|